import Mock from 'mockjs'

// 链路分布数据
export const mockLinkDistribution = () => {
  Mock.mock(/\/api\/link\/distribution/, 'get', (options) => {
    return {
      code: 200,
      message: 'success',
      data: [
        { longitude: 116.46, latitude: 39.92 },
        { longitude: 121.48, latitude: 31.22 },
        { longitude: 113.23, latitude: 23.16 },
        { longitude: 120.13, latitude: 30.23 },
        { longitude: 108.95, latitude: 34.27 },
        { longitude: 104.06, latitude: 30.67 },
        { longitude: 106.55, latitude: 29.56 },
        { longitude: 118.78, latitude: 32.04 }
      ]
    }
  })
}

// 连接点排名数据
export const mockLinkRank = () => {
  Mock.mock(/\/api\/link\/rank/, 'get', () => {
    return {
      code: 200,
      message: 'success',
      data: {
        phoneModels: ['北京', '上海', '广东', '江苏', '浙江', '山东', '河南', '四川', '湖北', '福建'],
        values: [120, 200, 150, 80, 70, 110, 130, 90, 95, 85]
      }
    }
  })
}

// 调用 mock 函数以启用模拟数据
mockLinkRank()